package com.news.mapper.entity.app;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 1.会员表(User)表实体类
 *
 * @author makejava
 * @since 2023-03-17 10:55:08
 */
@SuppressWarnings("serial")
@Data
@NoArgsConstructor
@TableName("t_user")
public class User{
    //序号，主键
    @TableId(type = IdType.AUTO)
    private Integer id;
    //用户名
    private String username;
    //手机号
    private String phone;
    //密码
    private String password;
    //标记位：1.有效 2无效
    private Integer flag;
    //创建时间
    private Date createTime;
    //修改时间
    private Date updateTime;

    public void init(){
        flag=1;
        createTime=new Date();
        updateTime=new Date();
    }

    public User(Integer id, String password) {
        this.id = id;
        this.password = password;
        this.updateTime=new Date();
    }
}

